// JavaScript Document By ZW
function chartInit(data,text,showType){
	var xAxisData = [];
	xAxisData =showType==1?
		['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月']
		:
		['1','2','3','4','5','6','7','8','9','10','11','12',"13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31"]
	data = eval(data);
	var myChart = echarts.init(document.getElementById('chart_main'));
	option = {
		title : { 
			text: text,
			subtext: ''
		},
		tooltip : {
			trigger: 'axis'
		},
		legend: {
			data:[text]
		},
		toolbox: {
			show : true,
			feature : {
				magicType : {show: true, type: ['line', 'bar']},
				restore : {show: true},
				saveAsImage : {show: true}
			}
		},
		calculable : true,
		//x轴
		xAxis : [
			{
				type : 'category',
				boundaryGap : false,
				data : xAxisData
			}
		],
		//y轴
		yAxis : [
			{
				type : 'value'
			}
		],
		series : [
			{
				name:text,
				type:'line',
				//数值
				data:data,
				markPoint : {
					data : [
						{type : 'max', name: '最大值'},
						{type : 'min', name: '最小值'}
					]
				}
			}
		]
	};
	myChart.setOption(option);	
}